import  com.lucastex.grails.fileuploader.UFile

// 学校的基本信息
class SchoolInfo {
    String name = ''
    String adds = ''
    String level = '' //等级
    String tel = ''
    String post = '' //邮编
    String headmaster = '' //校长

    UFile logo
    
    
    String description = '' //
    School school
//    static belongsTo = [school:School]

    static constraints = {
		name(blank: false, size:0..250)
		headmaster(blank: true, size:0..100)
		level(blank: true, size:0..100)
		adds(blank: true, size:0..250)
		post(blank: true, size:0..10, matches:"[0-9]+")
		tel(blank: true, size:0..100, matches:"[0-9-]+")
 	 
        description(blank: true, size:0..1000)

        school unique:true , nullable:true

        logo(nullable: true ) 
    }

    static mapping = {
       table 'xedu_school_info'
     }

    String toString (){
        "$name"
    }
}
